package com.hua.yuan.common;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by huangyang on 2018/5/9.
 * 基类
 */

public class BaseActivity extends AppCompatActivity {
    @Override
    public void startActivity(final Intent intent) {
        if(getPackageManager().resolveActivity(intent,PackageManager.MATCH_DEFAULT_ONLY) != null) {

            super.startActivity(intent);
        }
    }

    @Override
    public void startActivityForResult(final Intent intent, final int requestCode) {
        if(getPackageManager().resolveActivity(intent,PackageManager.MATCH_DEFAULT_ONLY) != null) {
            super.startActivityForResult(intent, requestCode);
        }
    }
}
